﻿using System;
using System.Globalization;
using System.Windows.Data;
using PDFDesign.Model.Const;

namespace PDFDesign.Converter
{
    public class PDFSizeConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var pdfSize = PDFSize.A4;
            Enum.TryParse(value.ToString(), out pdfSize);
            return pdfSize;
        }
    }
}
